package xyz.xtt.asset.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;

import xyz.xtt.asset.client.request.CardInfoRequest;
import xyz.xtt.asset.entity.TblAssetCard;
import xyz.xtt.asset.entity.TblAssetNo;
import xyz.xtt.asset.vo.AssetCardInfo;
import xyz.xtt.pay.client.response.TblPayOrderDto;

/**
 * <p>
 * 资产实体卡表 服务类
 * </p>
 *
 * @author author
 * @since 2025-02-25
 */
public interface ITblAssetCardService extends IService<TblAssetCard> {

	AssetCardInfo getAssetByCardId(Long cardId);

	/**
	 * 更改卡片领取状态
	 */
	void updateAssetCardReceiveState(TblPayOrderDto payOrderDto);


	/**
	 * 作废卡片
	 *
	 * @param assetId
	 * @param userId
	 * @return
	 */
	boolean destoryCard(Long assetId, Long userId);

	List<TblAssetCard> getUserCardInfo(CardInfoRequest cardInfoRequest);

	/**
	 * 生成卡片
	 *
	 * @param assetId
	 * @param userId
	 * @return
	 */
	boolean genCard(Long assetId, Long userId);

	/**
	 * 作废N张卡片
	 * 
	 * @param assetId
	 * @param userId
	 * @param n
	 * @return
	 */
	boolean destoryCard(Long assetId, Long userId, int n);

	/**
	 * 作废同一资产编号下的卡牌
	 * @param assetNoId
	 */
    void updateUserRepeatCardInvalid(long assetNoId);

	/**
	 * 为卡牌申领人添加新卡牌
	 * @param tblAssetNo
	 */
	boolean insertAssetCard(TblAssetNo tblAssetNo);

	/**
	 * 批量作废资产编号下的卡牌
	 * @param assetNoIds
	 */
	void updateInvalidByAssetNos(List<Long> assetNoIds);
}